package cn.xiaopengstack.test.framework.singleton;

import cn.xiaopengstack.types.framework.strategy.link.singleton.ILogicLink;
import lombok.Data;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class LinkSingletonFactory {

    @Resource
    private Rule1 singletonRule1;
    @Resource
    private Rule2 singletonRule2;

    public ILogicLink<Object, DynamicContext, RuleResponse> link(){
        singletonRule1.appendNext(singletonRule2);
        return singletonRule1;
    };

    @Data
    public static class DynamicContext{
        private String number;
    }
}
